Skip to content

Translate event handling page #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 7, 2019

Conversation

andriawan
Copy link

No description provided.


The logic for many event handlers will be more complex though, so keeping your JavaScript in the value of the `v-on` attribute isn't feasible. That's why `v-on` can also accept the name of a method you'd like to call.
Bagaimanapun baris kode untuk banyak event handler akan terlihat rumit, jadi menempatkan kode JavaScript Anda dalam `v-on` atribut tidaklah tepat. Itulah mengapa `v-on` dapat juga menerima nama metode yang ingin dijalankan.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atribut 'v-on'

<div id="example-2">
<!-- `greet` is the name of a method defined below -->
<div id="contoh-2">
<!-- `greet` adalah nama metode yang telah didefinisikan dibawah -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dibawah => di bawah

<!-- immediately, instead of waiting for `onScroll` to complete -->
<!-- in case it contains `event.preventDefault()` -->
<!-- perilaku bawaan event scroll (scrolling) akan terjadi -->
<!-- seger, dari pada menunggu `onScroll` selesai -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seger => segera


<p class="tip">Don't use `.passive` and `.prevent` together, because `.prevent` will be ignored and your browser will probably show you a warning. Remember, `.passive` communicates to the browser that you _don't_ want to prevent the event's default behavior.</p>
<p class="tip">Jangan menggunakan `.passive` dan `.prevent` bersamaan, karena `.prevent` akan diabaikan dan browser anda kemungkinan akan menampilkan peringatan. Ingat, `.passive` berkomunikasi dengan broswer yang mana anda tidak ingin mencegah perilaku bawaan event.</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anda => Anda


``` html
<input v-on:keyup.page-down="onPageDown">
```

In the above example, the handler will only be called if `$event.key` is equal to `'PageDown'`.
Pada contoh di atas, handler hanya akan dipanggail jika `$event.key` sama dengan `'PageDown'`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dipanggail => dipanggil

- `.esc`
- `.space`
- `.up`
- `.down`
- `.left`
- `.right`

<p class="tip">A few keys (`.esc` and all arrow keys) have inconsistent `key` values in IE9, so these built-in aliases should be preferred if you need to support IE9.</p>
<p class="tip">beberapa kunci (.esc dan semua tombol arah) memiliki nilai key yang tidak konsisten pada peramban IE9, jadi alias yang telah tersedia di atas lebih disarankan jika anda butuh dukungan untuk peramban IE9.</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huruf pertama harusnya kapital


2. Since you don't have to manually attach event listeners in JS, your ViewModel code can be pure logic and DOM-free. This makes it easier to test.
2. Sejak anda tidak membutuhkan peletakkan event listeners dalam JS secara manual, baris kode ViewModel menjadi berisi murni logika dan bebas DOM. Ini memudahkan dalam pengujian.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anda => Anda

@andriawan
Copy link
Author

@dikisiswanto terima kasih atas reviewnya. akan saya perbaiki kembali


You can use the following modifiers to trigger mouse or keyboard event listeners only when the corresponding modifier key is pressed:
Anda dapat menggunakan modifier dibawah untuk memicu mouse atau keyboard event listener hanya pada saat modifier tertentu ditekan:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dibawah harusnya di bawah

Copy link

@dikisiswanto dikisiswanto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beberapa bagian yang mungkin sebaiknya diperbaiki.

@dikisiswanto
Copy link

oke mas @andriawan

@mazipan mazipan mentioned this pull request Mar 7, 2019
Copy link
Member

@mazipan mazipan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perbaiki dulu komentar-komentarnya ya mas


The logic for many event handlers will be more complex though, so keeping your JavaScript in the value of the `v-on` attribute isn't feasible. That's why `v-on` can also accept the name of a method you'd like to call.
Bagaimanapun baris kode untuk banyak event handler akan terlihat rumit, jadi menempatkan kode JavaScript Anda dalam atribut `v-on` tidaklah tepat. Itulah mengapa `v-on` dapat juga menerima nama metode yang ingin dijalankan.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event handler nya pake Italic mas

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logika untuk banyak event handler akan menjadikannya lebih kompleks,


Instead of binding directly to a method name, we can also use methods in an inline JavaScript statement:
Dari pada menempatkan nama metode secara langsung, kita juga dapat menggunakan metode dalam sebuah inline JavaScript statement:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript sebaris (inline)

@@ -141,7 +141,7 @@ new Vue({
</script>
{% endraw %}

Sometimes we also need to access the original DOM event in an inline statement handler. You can pass it into a method using the special `$event` variable:
Terkadang kita juga butuh akses ke event DOM bawaan dalam inline statement handler. Anda dapat menempatkan variabel khusus `$event` ke dalam sebuah metode:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dalam handler statement sebaris

if (event) event.preventDefault()
alert(message)
}
}
```

## Event Modifiers
## Event Modifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pengubah Event

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atau bisa jelaskan dengan
Pengubah (Modifier) Event


To address this problem, Vue provides **event modifiers** for `v-on`. Recall that modifiers are directive postfixes denoted by a dot.
Untuk menyelesaikan masalah ini, Vue menyediakan **event modifier** untuk `v-on`. Penggunaan modifier tersebut ialah dengan tambahan direktif diawali dengan simbol titik.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pengubah event

<a v-on:click.stop="doThis"></a>

<!-- the submit event will no longer reload the page -->
<!-- the submit event tidak lagi memuat ulang halaman -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event submit

@@ -174,115 +174,115 @@ To address this problem, Vue provides **event modifiers** for `v-on`. Recall tha
- `.passive`

``` html
<!-- the click event's propagation will be stopped -->
<!-- click event propagation akan dihentikan -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perambatan event klik

<!-- use capture mode when adding the event listener -->
<!-- i.e. an event targeting an inner element is handled here before being handled by that element -->
<!-- gunakan mode capture saat menambahkan event listener -->
<!-- sebagai contoh, sebuah event menargetkan sebuah inner element ditangani disini sebelum ditangani oleh element tesebut -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

element -> elemen

<!-- only trigger handler if event.target is the element itself -->
<!-- i.e. not from a child element -->
<!-- handler hanya dipicu jiks event.target adalah element itu sendiri -->
<!-- sebagai contoh, tidak dari child element -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elemen anak

@andriawan
Copy link
Author

mas @mazipan suda saya perbaiki ulang. silahkan ditinjau kembali. untuk penggunaan kata key apakah seharusnya diterjemahkan ke kunci?

- change word "browser" to "peramban"
@andriawan andriawan changed the title translate event handling page Translate event handling page Mar 7, 2019
@@ -141,7 +141,7 @@ new Vue({
</script>
{% endraw %}

Sometimes we also need to access the original DOM event in an inline statement handler. You can pass it into a method using the special `$event` variable:
Terkadang kita juga butuh akses ke event DOM bawaan dalam statement _handler_ sebaris. Anda dapat menempatkan variabel khusus `$event` ke dalam sebuah metode:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statement -> statemen, ada beberapa diatas. replaceAll aja.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baik mas @mazipan

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudah saya perbaiki mas @mazipan

- change word "browser" to peramban
@mazipan mazipan merged commit a65571d into vuejs-id:master Mar 7, 2019
@andriawan andriawan deleted the translate-event-handling branch March 7, 2019 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants